package Gestionnaire;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import java.awt.Checkbox;
import javax.swing.JCheckBoxMenuItem;
import java.awt.ScrollPane;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.border.TitledBorder;
import javax.swing.border.LineBorder;
import java.awt.Color;
import javax.swing.JComboBox;
import javax.swing.DefaultComboBoxModel;

public class FenetrePrincipale extends JFrame {

	/**
	 * @uml.property  name="contentPane"
	 * @uml.associationEnd  multiplicity="(1 1)"
	 */
	private JPanel contentPane;
	private JTable table;
	private JTable table_1;
	private JTextField textField;
	private JTable table_2;
	private JTable table_3;
	private JTable table_4;
	private JTable table_5;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					FenetrePrincipale frame = new FenetrePrincipale();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public FenetrePrincipale() {
		setTitle("Gestionnaire Masterquizz");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 900, 600);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		tabbedPane.setBounds(0, 0, 884, 562);
		contentPane.add(tabbedPane);
		
		JPanel categorie = new JPanel();
		tabbedPane.addTab("Gestion cat\u00E9gorie", null, categorie, null);
		categorie.setLayout(null);
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setBounds(44, 51, 790, 383);
		categorie.add(scrollPane);
		
		table = new JTable();
		scrollPane.setViewportView(table);
		table.setModel(new DefaultTableModel(
			new Object[][] {
				{"1", "Jrm_57", "Football", "10/10/2011", "100", "oui"},
				{"2", "Sherman57", "Chat", "15/02/2012", "200", "oui"},
				{"3", "Djo54", "Polo volksagen", "20/01/2012", "50", "non"},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
			},
			new String[] {
				"Code", "Pseudo", "Libell\u00E9 cat\u00E9gorie", "Date de cr\u00E9ation", "Vote", "Validation"
			}
		) {
			boolean[] columnEditables = new boolean[] {
				true, true, false, true, false, false
			};
			public boolean isCellEditable(int row, int column) {
				return columnEditables[column];
			}
		});
		table.getColumnModel().getColumn(0).setPreferredWidth(46);
		table.getColumnModel().getColumn(2).setResizable(false);
		table.getColumnModel().getColumn(2).setPreferredWidth(120);
		table.getColumnModel().getColumn(3).setPreferredWidth(96);
		table.getColumnModel().getColumn(4).setResizable(false);
		table.getColumnModel().getColumn(5).setResizable(false);
		table.getColumnModel().getColumn(5).setPreferredWidth(65);
		
		JLabel lblProposerUneCatgorie = new JLabel("Liste des cat\u00E9gories :");
		lblProposerUneCatgorie.setBounds(44, 22, 141, 16);
		categorie.add(lblProposerUneCatgorie);
		
		JPanel question = new JPanel();
		tabbedPane.addTab("Gestion question", null, question, null);
		question.setLayout(null);
		
		JLabel lblListeDesQuestions = new JLabel("Liste des questions :");
		lblListeDesQuestions.setBounds(45, 22, 122, 16);
		question.add(lblListeDesQuestions);
		
		JScrollPane scrollPane_1 = new JScrollPane();
		scrollPane_1.setBounds(45, 64, 790, 383);
		question.add(scrollPane_1);
		
		table_1 = new JTable();
		table_1.setModel(new DefaultTableModel(
			new Object[][] {
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
			},
			new String[] {
				"No", "Pseudo", "Cat\u00E9gorie", "Question", "R\u00E9ponse", "Valider"
			}
		));
		table_1.getColumnModel().getColumn(0).setPreferredWidth(31);
		table_1.getColumnModel().getColumn(3).setPreferredWidth(180);
		table_1.getColumnModel().getColumn(4).setPreferredWidth(180);
		scrollPane_1.setViewportView(table_1);
		
		JLabel lblSupprimerLaQuestion = new JLabel("Supprimer la question n\u00B0 : ");
		lblSupprimerLaQuestion.setBounds(45, 472, 157, 16);
		question.add(lblSupprimerLaQuestion);
		
		JButton btnOk = new JButton("Ok");
		btnOk.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent arg0) {
				ConfirmationSuppression conf = new ConfirmationSuppression();
				conf.show();
			}
		});
		btnOk.setBounds(277, 467, 50, 26);
		question.add(btnOk);
		
		textField = new JTextField();
		textField.setBounds(202, 470, 63, 20);
		question.add(textField);
		textField.setColumns(10);
		
		JPanel utilisateur = new JPanel();
		tabbedPane.addTab("Gestion utilisateur", null, utilisateur, null);
		utilisateur.setLayout(null);
		
		JScrollPane scrollPane_2 = new JScrollPane();
		scrollPane_2.setBounds(42, 63, 784, 343);
		utilisateur.add(scrollPane_2);
		
		table_2 = new JTable();
		scrollPane_2.setViewportView(table_2);
		table_2.setModel(new DefaultTableModel(
			new Object[][] {
				{"1", "jrm_57", "test1", "mol@toto.fr", "0685213565"},
				{"2", "sherm57", "toto2", "cat@lolo.fr", "0385123465"},
				{"3", "djo54", "tati2", "fourche@fifi.com", null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
			},
			new String[] {
				"No", "Pseudo", "Mot de passe", "Email", "T\u00E9l\u00E9phone"
			}
		));
		table_2.getColumnModel().getColumn(0).setPreferredWidth(58);
		table_2.getColumnModel().getColumn(1).setPreferredWidth(100);
		table_2.getColumnModel().getColumn(2).setPreferredWidth(107);
		table_2.getColumnModel().getColumn(3).setPreferredWidth(143);
		
		JLabel lblListeDesUtilisateurs = new JLabel("Liste des utilisateurs : ");
		lblListeDesUtilisateurs.setBounds(42, 24, 142, 16);
		utilisateur.add(lblListeDesUtilisateurs);
		
		JLabel lblSelectionnerLutilisateur = new JLabel("Selectionner l'utilisateur \u00E0 supprimer et cliquez sur : ");
		lblSelectionnerLutilisateur.setBounds(42, 453, 305, 16);
		utilisateur.add(lblSelectionnerLutilisateur);
		
		JButton button = new JButton("Ok");
		button.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				ConfirmationUtilisateur cf = new ConfirmationUtilisateur();
				cf.show();
			}
		});
		button.setBounds(353, 448, 73, 26);
		utilisateur.add(button);
		
		JPanel statistique = new JPanel();
		tabbedPane.addTab("Statistiques", null, statistique, null);
		statistique.setLayout(null);
		
		JTabbedPane tabbedPane_1 = new JTabbedPane(JTabbedPane.TOP);
		tabbedPane_1.setBounds(0, 0, 879, 534);
		statistique.add(tabbedPane_1);
		
		JPanel joueur_nconect = new JPanel();
		tabbedPane_1.addTab("Joueurs non connect\u00E9s", null, joueur_nconect, null);
		joueur_nconect.setLayout(null);
		
		JPanel panel_1 = new JPanel();
		panel_1.setBorder(new TitledBorder(null, "Evolution des joueurs connect\u00E9s", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		panel_1.setLayout(null);
		panel_1.setBounds(58, 32, 709, 196);
		joueur_nconect.add(panel_1);
		
		JScrollPane scrollPane_3 = new JScrollPane();
		scrollPane_3.setBounds(51, 27, 603, 157);
		panel_1.add(scrollPane_3);
		
		table_3 = new JTable();
		scrollPane_3.setViewportView(table_3);
		table_3.setModel(new DefaultTableModel(
			new Object[][] {
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
			},
			new String[] {
				"No", "Pseudo", "Nombre de fois connect\u00E9", "Nb bonnes r\u00E9ponses", "Nb mauvaises r\u00E9ponses"
			}
		) {
			Class[] columnTypes = new Class[] {
				Object.class, String.class, Object.class, Object.class, Object.class
			};
			public Class getColumnClass(int columnIndex) {
				return columnTypes[columnIndex];
			}
		});
		table_3.getColumnModel().getColumn(2).setPreferredWidth(167);
		table_3.getColumnModel().getColumn(3).setPreferredWidth(143);
		table_3.getColumnModel().getColumn(4).setPreferredWidth(156);
		
		JPanel panel_2 = new JPanel();
		panel_2.setBorder(new TitledBorder(null, "Evolution des joueurs non connect\u00E9s", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		panel_2.setLayout(null);
		panel_2.setBounds(58, 240, 709, 196);
		joueur_nconect.add(panel_2);
		
		JScrollPane scrollPane_4 = new JScrollPane();
		scrollPane_4.setBounds(49, 54, 601, 128);
		panel_2.add(scrollPane_4);
		
		table_4 = new JTable();
		scrollPane_4.setViewportView(table_4);
		table_4.setModel(new DefaultTableModel(
			new Object[][] {
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
			},
			new String[] {
				"No", "Pseudo", "Non connect\u00E9 depuis", "Nb bonnes r\u00E9ponses", "Nb mauvaises r\u00E9ponses"
			}
		));
		table_4.getColumnModel().getColumn(2).setPreferredWidth(150);
		table_4.getColumnModel().getColumn(3).setPreferredWidth(152);
		table_4.getColumnModel().getColumn(4).setPreferredWidth(156);
		
		JLabel lblFiltre = new JLabel("Filtre : ");
		lblFiltre.setBounds(12, 26, 55, 16);
		panel_2.add(lblFiltre);
		
		JComboBox comboBox = new JComboBox();
		comboBox.setModel(new DefaultComboBoxModel(new String[] {"1 jours", "1 semaine", "1 mois "}));
		comboBox.setBounds(71, 22, 96, 25);
		panel_2.add(comboBox);
		
		JPanel reponse = new JPanel();
		tabbedPane_1.addTab("Evaluation des r\u00E9ponses", null, reponse, null);
		reponse.setLayout(null);
		
		JPanel panel_3 = new JPanel();
		panel_3.setBorder(new TitledBorder(null, "Evolution des r\u00E9ponses", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		panel_3.setLayout(null);
		panel_3.setBounds(64, 51, 709, 379);
		reponse.add(panel_3);
		
		JScrollPane scrollPane_5 = new JScrollPane();
		scrollPane_5.setBounds(28, 28, 644, 328);
		panel_3.add(scrollPane_5);
		
		table_5 = new JTable();
		scrollPane_5.setViewportView(table_5);
		table_5.setModel(new DefaultTableModel(
			new Object[][] {
				{"1", "La m\u00E8re michelle qui a perdu son ?", "Expression", "50", "20"},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
			},
			new String[] {
				"No", "Libell\u00E9", "Cat\u00E9gorie", "Bonne r\u00E9ponse", "Mauvaise r\u00E9ponse"
			}
		));
		table_5.getColumnModel().getColumn(0).setPreferredWidth(58);
		table_5.getColumnModel().getColumn(1).setPreferredWidth(242);
		table_5.getColumnModel().getColumn(2).setPreferredWidth(103);
		table_5.getColumnModel().getColumn(3).setPreferredWidth(134);
		table_5.getColumnModel().getColumn(4).setPreferredWidth(132);
		
		JPanel nb_inscrit = new JPanel();
		tabbedPane_1.addTab("Nombre d'inscrits", null, nb_inscrit, null);
		nb_inscrit.setLayout(null);
		
		JPanel panel = new JPanel();
		panel.setBorder(new TitledBorder(new LineBorder(new Color(184, 207, 229)), "Evolution des inscrits : ", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		panel.setBounds(318, 128, 268, 196);
		nb_inscrit.add(panel);
		panel.setLayout(null);
		
		JLabel lblNewLabel = new JLabel("Nombre total d'inscrits : ");
		lblNewLabel.setBounds(12, 37, 168, 16);
		panel.add(lblNewLabel);
		
		JLabel lblNewLabel_1 = new JLabel("Nombre d'inscrits cette derni\u00E8re semaine : ");
		lblNewLabel_1.setBounds(12, 78, 258, 16);
		panel.add(lblNewLabel_1);
		
		JLabel lblNombreDinscritsCe = new JLabel("Nombre d'inscrits ce dernier mois : ");
		lblNombreDinscritsCe.setBounds(12, 128, 243, 16);
		panel.add(lblNombreDinscritsCe);
	}
}
